const express = require('express')
const port = 9069
const expressws = require('express-ws')(express())
const app = expressws.app
const { backSuc } = require('./util/back')
//express 创建在线io接口
app.ws('/connection', (ws, req) => {
    //监听web端传来的信息
    ws.on('message', async (msg) => {
        if (msg == 'already connect now') {
           backSuc({msg:'ok'},ws)
        }
    })
})

app.listen(port, () => {
    console.log('io is run now ！')
})